<?php
	$errorMessage="";
	
	if($_POST['signup']==1){
		$res = registerToDB($_POST['name'],$_POST['surname'],$_POST['faculty'],$_POST['group'],$_POST['email'],$_POST['login'],$_POST['password']);
		$_POST['signup']=0;
		$_SESSION['page_status']=0;$_GET['option']='users'; $_GET['task']='login'; require("index.php");
	}
		$query = mysql_query("SELECT * FROM faculties");
		$num = mysql_num_rows($query);
		$fac_names;
		fac_ids;
		$fac_names[0]="Choose your faculty...";;
		$fac_ids[0]=0;
		for($i=1;$i<$num+1;$i++){
			$res = mysql_fetch_array($query);
			$fac_ids[$i]=$res['faculty_id'];
			$fac_names[$i]=$res['faculty_name'];	
		}

		$smarty->assign('fac_ids',$fac_ids);
		$smarty->assign('fac_names',$fac_names);

		$smarty->display('register.tpl');

	
?>